package org.eclipse.gittab.fretboard.draw2d.painters;

import org.eclipse.gittab.fretboard.Fretboard.Configuration;
import org.eclipse.gittab.fretboard.Fretboard.FretboardListener;
import org.eclipse.gittab.fretboard.internal.IFretboardPainter;
import org.eclipse.gittab.fretboard.internal.IFretboardPainterFactory;

/**
 * Factory for creating a {@link IFretboardPainter} implementation. </p> Returns
 * either {@link StandardFretboardPainter} or {@link LeftyFretboardPainter}
 * depending on the configuration.
 * 
 * @author mat
 * 
 */
public class FretboardPainterFactory implements IFretboardPainterFactory {

	@Override
	public IFretboardPainter createFretboardPainter(
			FretboardListener listener, Configuration configuration) {

		if (configuration.isLefty()) {
			return new LeftyFretboardPainter(listener);
		}
		return new StandardFretboardPainter(listener);
	}
}
